package com.sixbro.shiro.jwt.controller;

import cn.hutool.json.JSONObject;
import com.bxs.rbac.shiro.jwt.domain.entity.User;
import com.bxs.response.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * <p>
 *
 * </p>
 *
 * @Author: Mr.Lu
 * @Since: 2020/6/17 17:52
 */
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {
    private static final Logger _logger = LoggerFactory.getLogger(UserController.class);

    @RequestMapping(value = "/add")
    public String add(){
        _logger.info("用户添加");
        return "modules/user/add";
    }

    @RequestMapping(value = "/delete")
    public String delete(){
        _logger.info("用户删除");
        return "modules/user/add";
    }

    @RequestMapping(value = "/list")
    public ApiResponse list(){
        _logger.info("用户列表");
        return ApiResponse.success(new JSONObject().put("result", new ArrayList<User>()));
    }

    @RequestMapping(value = "/update")
    //@RequiresPermissions(value = "user:update")
    public String update(){
        _logger.info("用户更新");
        return "modules/user/add";
    }
}
